home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / CARROLLN.CMD < prev    next >
Encoding:
Text File  |  1996-02-14  |  2.9 KB  |  137 lines

  1. #        C a r r o l l - N e t, Inc.
  2. #
  3. #  Trumpet Winsock 2.1 Login.cmd
  4. #
  5. #  Copyright (C) 1994,1995 Peter R. Tattam & 
  6. #  Trumpet Software International Pty Ltd (TSI)
  7. #  All rights reserved.
  8. #
  9. #  Unless TSI has given prior written consent to such use, 
  10. #  no permission is granted to distribute or otherwise make available 
  11. #  to the public modified versions of this script for commercial purposes.  
  12. #  Any permitted distribution of modified versions of the script must
  13. #  retain the copyright notice at the start of this file and must clearly 
  14. #  identify those parts of the file which have been modified.
  15. #
  16. #  version 960108    added support for 2.0b
  17. #  version 951224    removed additional dialups
  18. #
  19.  
  20. set dtr off
  21.  
  22. #trace on
  23. #
  24. # set up some strings for dialling up
  25. #
  26. display \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
  27.  
  28. if ![load $anumber]
  29.   display "You need to run the Dialler/Setup.cmd script, e1"
  30.   abort
  31. end
  32.  
  33. if ![load $bnumber]
  34.   display "You need to run the Dialler/Setup.cmd script, e2"
  35.   abort
  36. end
  37.  
  38. if ![load $username]
  39.   display "You need to run the Dialler/Setup.cmd script, e5"
  40.   abort
  41. end
  42.  
  43. if ![load $password]
  44.   display "You need to run the Dialler/Setup.cmd script, e6"
  45.   abort
  46. end
  47.  
  48. if ![load $modeminit]
  49.   display "You need to run the Dialler/Setup.cmd script, e7"
  50.   abort
  51. end
  52.  
  53. if ![load %attempts]
  54.   display "You need to run the Dialler/Setup.cmd script, e8"
  55.   abort
  56. end
  57.  
  58. $userprompt = "login:"
  59. $passprompt = "sword:"
  60.  
  61. #
  62. # send phone number
  63. #
  64. $num = ""
  65. %which = 0
  66. %n = 0
  67. repeat
  68.   set dtr off
  69.   sleep 1
  70.   set dtr on
  71.   sleep 1
  72.   #
  73.   # setup our modem commands
  74.   #
  75.   output "at"$modeminit\13
  76.   if ! [input 5 OK\n]
  77.     display "Modem is not responding"
  78.     abort
  79.   end
  80.   %n = %n + 1
  81.   if %n > %attempts
  82.     display "Too many dial attempts"
  83.     abort
  84.   end
  85.   %which = %which + 1
  86.   if %which > 2
  87.     %which = 1
  88.   end
  89.   if %which = 1
  90.     $num = $anumber
  91.   end
  92.   if %which = 2
  93.     $num = $bnumber
  94.   end
  95.   display Dialing $num...(attempt %n)\n
  96.   output "atdt"$num\13
  97.   display \n
  98.   %ok = [input 30 CONNECT]
  99. until %ok
  100. input 10 \n
  101.  
  102. #
  103. #  wait till it's safe to send because some modem's hang up
  104. #  if you transmit during the connection phase
  105. #
  106. wait 10 dcd
  107. display \nModems are now connected.\n
  108.  
  109. #
  110. #  wait for the username prompt
  111. #
  112. display \nTrying to login with username $username\n
  113. input 5 $userprompt
  114. output $username\13
  115.  
  116. #
  117. # and the password
  118. #
  119. input 2 $passprompt
  120. output $password\13
  121.  
  122. #
  123. # we are now logged in
  124. #
  125. %ok = [input 3 PPP]
  126. if !%ok
  127.   display \n\nYou were unable to login.  The most likely cause is that\n
  128.   display you have an invalid username or password.  Please re-run\n
  129.   display Dialler/Setup.cmd, and re-type the information\n
  130.   abort
  131. end
  132.  
  133. display \n\nLogged in. Now trying to bring up PPP Session\n\n
  134. display Your session will be active when you see a series of\n
  135. display non-zero digits following the string \"My IP address =\"\n\n
  136.  
  137. sleep 1